package com.yellowpage.bigdata.action;
  
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;





import com.yellowpage.bigdata.data.O2oRetentionDay;
import com.yellowpage.bigdata.service.O2oRetentionDayService;
import com.yellowpage.white.struts.BaseAction;

public class O2oRetentionDayAction extends BaseAction {
 
	private O2oRetentionDay o2oRetentionDay;
	private O2oRetentionDayService o2oRetentionDayService;
	
	private String selectedId;
	private String query_logDate;
	private String query_o2o_id;
	private String query_logDate_end;
	private List<Map> resultList = new ArrayList<Map>();
	private Map O2oIdMap = new HashMap();
	
		 
	public void prepare() {
		super.prepare();
		 //加载O2O_ID  
		 O2oIdMap = o2oRetentionDayService.getO2oIdMap();
		 if (this.selectedId != null && !this.selectedId.equals("")) {
				this.o2oRetentionDay = o2oRetentionDayService.getO2oRetentionDay(Long.parseLong(selectedId));
			}	 
	}
	
	public String queryByPage() {		
		initPageRender();
		Map<String,String> queryMap = new HashMap<String,String>();	
	    queryMap.put("o2oId", query_o2o_id);
	    queryMap.put("logDate", query_logDate);
		queryMap.put("query_logDate_end", query_logDate_end);
	    	    	
		resultList = o2oRetentionDayService.queryO2oRetentionDayByPage(queryMap, pageRender);
		
		setPageRenderToRequest();

		return "query";
	}

	public O2oRetentionDay getO2oRetentionDay() {
		return o2oRetentionDay;
	}

	public void setO2oRetentionDay(O2oRetentionDay o2oRetentionDay) {
		this.o2oRetentionDay = o2oRetentionDay;
	}

	public O2oRetentionDayService getO2oRetentionDayService() {
		return o2oRetentionDayService;
	}

	public void setO2oRetentionDayService(
			O2oRetentionDayService o2oRetentionDayService) {
		this.o2oRetentionDayService = o2oRetentionDayService;
	}

	public String getSelectedId() {
		return selectedId;
	}

	public void setSelectedId(String selectedId) {
		this.selectedId = selectedId;
	}

	public String getQuery_logDate() {
		return query_logDate;
	}

	public void setQuery_logDate(String query_logDate) {
		this.query_logDate = query_logDate;
	}

	public String getQuery_o2o_id() {
		return query_o2o_id;
	}

	public void setQuery_o2o_id(String query_o2o_id) {
		this.query_o2o_id = query_o2o_id;
	}

	public String getQuery_logDate_end() {
		return query_logDate_end;
	}

	public void setQuery_logDate_end(String query_logDate_end) {
		this.query_logDate_end = query_logDate_end;
	}

	public List<Map> getResultList() {
		return resultList;
	}

	public void setResultList(List<Map> resultList) {
		this.resultList = resultList;
	}

	public Map getO2oIdMap() {
		return O2oIdMap;
	}

	public void setO2oIdMap(Map o2oIdMap) {
		O2oIdMap = o2oIdMap;
	}
	
}
